import logging


date_format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
date_format1='%Y-%m-%d %H:%M:%S'


logging.basicConfig(
    level=logging.DEBUG,   #设置日志级别
    format=date_format,    #设置时间戳
    datefmt=date_format1,  #设置时间戳格式
    filename='day03.log',  #只输出到文件 默认追加
    filemode='w'           #复盖
    #stream=sys.stdout,    #只输出到控制台默认
)

logging.debug("hello word")
logging.info('hello word')
logging.warning("hello word")
logging.error("hello word")
logging.critical("hello word")




